<template>
  <div>
    <slot name="rowText" :items="processedItems"></slot>
    <!-- 使用作用域插槽传递处理后的数组 -->
  </div>
</template>

<script lang="ts" setup>
  import { computed} from 'vue';
  const props = defineProps({
    itemsString: {
      type: String,
      required: true,
    },
  });
  console.log('props.itemsString:', props.itemsString);
  // // 处理字符串：分割并去除空格

  const processedItems = computed(
    () =>
      props.itemsString
        .split(',')
        .map((item) => item.trim())
        .filter((item) => item !== ''), // 过滤空值
  );
</script>
